package com.tf.xx.listener;

import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.annotation.WebListener;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

@WebListener
public class MyContextListener implements ServletContextListener {
    private static final Logger logger =
            LoggerFactory.getLogger(MyContextListener.class);

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        logger.info("Web 应用已启动 - 开始初始化");
    }


    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        logger.info("Web 应用已停止 - 执行清理");
    }
}
